package st.business.tepth.business.visitor;

import io.reactivex.disposables.Disposable;
import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.FactoryInfo;
import st.business.tepth.business.bean.LocationBean;
import st.business.tepth.manager.UserBean;
import st.shadow.library.core.base.mvp.BaseModel;
import st.shadow.library.core.base.mvp.BasePresenter;
import st.shadow.library.core.base.mvp.BaseView;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-03-05 16:53
 */

public interface VisitorContract {
    interface View extends BaseView {
        void showLocationInfo(LocationBean locationBean);

        void setInfoSucceed(String msg);

        void showError(String msg);

        void verificationFactoryInfo(FactoryInfo factoryInfo);

        void succeed(UserBean userBean);
    }

    interface Model extends BaseModel {
        Disposable getLocationInfo(String id,
                                   OnDataConvertListener<LocationBean> listener);

        Disposable getFactoryInfo(String androidId,
                                  OnDataConvertListener<FactoryInfo> succeedListener,
                                  OnDataConvertListener<LocationBean> listener);

        Disposable setFactoryInfo(String androidId, int factoryId,
                                  int groupId, String factoryName,
                                  OnDataConvertListener<String> setListener,
                                  OnDataConvertListener<LocationBean> dataListener);
        Disposable login(String account, String password, int type,
                         OnDataConvertListener<UserBean> listener);
    }

    abstract class Presenter extends BasePresenter<View> {
        abstract void getLocationInfo(String id);

        abstract void getFactoryInfo(String androidId);

        abstract void setFactoryInfo(String androidId, int factoryId,
                                     int groupId,
                                     String factoryName);
        abstract void login(String account, String password, int type);
    }
}
